﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WSCompress
{
    public partial class MainForm : Form
    {
        private WebServices.DataService ws;
        private DataSet ds;

        public MainForm()
        {
            InitializeComponent();
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
            ws = new WebServices.DataService();
        }

        private void checkOutMenuItem_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            ds = ws.CheckOutCustomers();
            xmlTextBox.Text = ds.GetXml();
            Cursor.Current = Cursors.Default;
            MessageBox.Show("Checked out!", "Customers");
        }

        private void checkInMenuItem_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            ws.CheckInCustomers(ds);
            xmlTextBox.Text = string.Empty;
            Cursor.Current = Cursors.Default;
            MessageBox.Show("Checked in!", "Customers");
        }

        private void doneMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}